<?php

namespace common\models\app;

use Yii;

/**
 * This is the model class for table "{{%app_device}}".
 *
 * @property int $id
 * @property string $sn 序列号
 * @property string $imei IMEI机器码
 * @property string $os 操作系统
 * @property string $model 设备机型
 * @property string $build build版本序列号
 * @property string $push_token 推送Token
 * @property string $created_at 创建时间
 * @property string $updated_at 更新时间
 * @property string $deleted_at 删除时间
 */
class AppDevice extends \common\base\ActiveRecord {

    use \common\traits\Constants;
    use \common\traits\TimestampBehavior;
    use \common\traits\QueryInstanceActiveRecord;

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%app_device}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['sn'], 'required'],
            [['os'], 'string'],
            [['build', 'created_at', 'updated_at', 'deleted_at'], 'integer'],
            [['sn', 'imei', 'model'], 'string', 'max' => 64],
            [['push_token'], 'string', 'max' => 32],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'sn' => '序列号',
            'imei' => 'IMEI机器码',
            'os' => '操作系统',
            'model' => '设备机型',
            'build' => 'build版本序列号',
            'push_token' => '推送Token',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
            'deleted_at' => '删除时间',
        ];
    }

}
